﻿using System.ComponentModel;

namespace MVVM_Learning.ViewModels
{
    // 具有通知能力的对象，是viewmodels中其他类的基类
    internal class Notificationobject : INotifyPropertyChanged  // I开头一般是接口（抽象的类：只提供了定义，没有具体实现）
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public void RaisePropertyChanged(string propertyName)
        { 
            if(PropertyChanged != null) 
            {
                this.PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
